Skip to main content

Run Script

AutomatR.DefaultActivities.Python.RunScript

The "Run Script" activity in AutomatR enables the execution of a Python script using a specified Python interpreter. This versatile activity allows you to integrate Python scripts seamlessly into your automation workflows.

Properties

NameDescription
Input
Enter Method ParametersEnter the parameters/arguments in the code file as an Enumerable object list up to 9. The path should be specified as follows: Example - D:/abc/xyz/. Enumerable object containing the parameters for the Python script.
Python FileSpecifies the Python path with the script file to be executed. String variables containing the path to the Python script file.
Python PathSpecifies the full path of the Python interpreter to be used for executing the script. String variables containing the path to the Python interpreter.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Run Script" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 5 seconds, enter 5.
Output
ResultReturns the output of the Python script execution as a string. String variables containing the result of the Python script execution.

How to use:

  1. Drag and drop the "Run Script" activity onto the workflow.
  2. Configure the properties by specifying the full path of the Python interpreter, the parameters for the Python script, and the path to the Python script file.
  3. Optionally, set the delay for the execution.
  4. Execute the workflow to run the specified Python script.
  5. The output of the Python script execution is stored in the variable specified in the "Result" property.

Example:

Consider an example where the "Run Script" activity is used to execute a Python script that processes input files and generates output images:

Run Script:
Display Name: "Process Input Files"
Python Path: "C:/Python38/python.exe"
Arguments: ["D:/InputFiles/", "D:/OutputImages/", "param3", ..., "param8"]
Python File: "C:/Scripts/ProcessFiles.py"
Result: scriptOutput

In this example, the activity executes the Python script located at "C:/Scripts/ProcessFiles.py" using the Python interpreter at "C:/Python38/python.exe". The input parameters for the script are specified in the "Arguments" property, and the output of the script is stored in the variable "scriptOutput" for further use in the workflow.